FIND_PACKAGE_HELPER(ZLIB zlib.h RELEASE zlibstatic zlib zdll zlib1 z DEBUG zlibstaticd zlibd zdlld zlibd1 zd QUIET)

IF(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
  PARSE_VERSION_OTHER(${ZLIB_INCLUDE_DIR}/zlib.h ZLIB_VERSION ZLIB_VER_MAJOR ZLIB_VER_MINOR ZLIB_VER_REVISION ZLIB_VER_SUBREVISION)

  IF(NOT ZLIB_VER_MAJOR)
    PARSE_VERSION_STRING(${ZLIB_VERSION} ZLIB_VERSION_MAJOR ZLIB_VERSION_MINOR ZLIB_VERSION_PATCH)
  ENDIF(NOT ZLIB_VER_MAJOR)
  
  MESSAGE_VERSION_PACKAGE_HELPER(ZLIB ${ZLIB_VERSION} ${ZLIB_LIBRARIES})
ENDIF(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
